#if !defined(AFX_SUBGROUPSURFACE_H__EBCEFE25_6B65_47C1_85A4_F85EB1A73636__INCLUDED_)
#define AFX_SUBGROUPSURFACE_H__EBCEFE25_6B65_47C1_85A4_F85EB1A73636__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SubgroupSurface.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CSubgroupSurface window

#include "BaseSurface.h"

class CBasePanel;
class SubgroupDisplay;
class CSubgroupDisplayWnd;

class CSubgroupSurface : public CBaseSurface
{
// Construction
public:
	CSubgroupSurface(CBasePanel * pPanel);

// Attributes
public:

protected:
  std::vector<CSubgroupDisplayWnd *> m_vecSubgroupDisplayWnds;
  CSubgroupDisplayWnd * m_pActiveSubgroupDisplayWnd;

 	int m_nHMax;
	int m_nHPos;

// Operations
public:
  virtual bool Create(CWnd * pParentWnd);
  virtual void Paint(CDC& dc);
  virtual void UpdateDefinitionDisplay(BaseCoalMineUnit * pCoalMineUnit);
  virtual void UpdateDataDisplay(BaseCoalMineUnit * pCoalMineUnit, BaseMonitoringUnit * pMonitoringUnit);
  virtual void ApplyOptions(DWORD dwOptionPagesMask);

  void CreateSubgroupDisplayWnd(SubgroupDisplay * pSubgroupDisplay);
  void DestroySubgroupDisplayWnd(SubgroupDisplay * pSubgroupDisplay);
  void DestroyAllSubgroupDisplayWnds();
  CSubgroupDisplayWnd * GetpSubgroupDisplayWndById(SubgroupDisplay * pSubgroupDisplay);
  CSubgroupDisplayWnd * GetpActiveSubgroupDisplayWnd() {return m_pActiveSubgroupDisplayWnd;}
  void ActivateSubgroupDisplayWnd(CSubgroupDisplayWnd * pSubgroupDisplayWnd);
  void ArrangeSubgroupDisplayWnds(bool bAutoSize = false);
  void MakeSubgroupDisplayWndWidthSame(CSubgroupDisplayWnd * pFromWnd);
  bool ChangeSubgroupDisplayWndPos(CSubgroupDisplayWnd * pSubgroupDisplayWnd, const CPoint& point);
  int GetSubgroupDisplayWndIndex(CSubgroupDisplayWnd * pSubgroupDisplayWnd) const;

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CSubgroupSurface)
	protected:
  virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CSubgroupSurface();

	// Generated message map functions
protected:
	//{{AFX_MSG(CSubgroupSurface)
	afx_msg void OnDestroy();
	afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_SUBGROUPSURFACE_H__EBCEFE25_6B65_47C1_85A4_F85EB1A73636__INCLUDED_)
